package com.huadao.cart_ccs.modle;

import android.content.Context;

import com.huadao.cart_ccs.base.BaseHttpModel;
import com.huadao.cart_ccs.data.bo.User;
import com.huadao.cart_ccs.data.source.http.Api;
import com.huadao.cart_ccs.data.source.http.HttpFunction;
import com.huadao.cart_ccs.data.source.http.RetrofitHelper;

import io.reactivex.Observable;


public class LoginModle extends BaseHttpModel {
    private Api api;

    public LoginModle(Context context) {
        api=RetrofitHelper.getInstance(context).create(Api.class);
    }

    public Observable<User> login(String userName, String password){
        return api.login(userName,password).map(new HttpFunction());
    }
}
